// Created by zyq on 2025/2/27.

#include<stdio.h>
#include<stdlib.h>

#include "iostream"

using namespace std;

/**
 * c语言
 * @return
 */
int main() {
    int *p = (int *) malloc(sizeof(int) * 3);

    if (p == NULL) {
        printf("NULL");

    }

    *p = 10;

    for (int i = 0; i < 3; i++) {
        *(p + i) = i + 1;
    }

    cout << *p << endl;
    cout << p << endl;

    for (int i = 0; i < 3; i++) {
        cout << *(p + i) << endl;
        cout << (p + i) << endl;
    }

    free(p);
    return 0;
}
